<?php 

defined('IN_TS') or die('Access Denied.');



if( $GLOBALS['TS_USER']!=''){
    $mylink = '&link='.$GLOBALS['TS_USER']['userid'];

}

$draft = $_GET['draft'];

#############处理微信内自动登录#####################

$link = $_GET['link'];

if(isWeixin()==true && ($GLOBALS['TS_USER']==''||$_SESSION['tsuser']['wxopenid']=='')&& $ac!='wxlogin'){
    $backurl=curPageURL();
    $_SESSION['backurl']=$backurl;
    getWeixinLoginCode('wx2ef8a11062078826',urlencode(tsUrl('user','wxlogin',array('upline'=>$link))),'snsapi_userinfo');
}

#############处理微信内自动登录#####################


require_once "plugins/pubs/weixin/jssdk.php";
$jssdk = new JSSDK("wx2ef8a11062078826", "16863a6f1c9e1a438b5c05922681c3d3");
$signPackage = $jssdk->GetSignPackage();

if(!$cover){
    $cover=SITE_URL.'public/images/logo300.png';
}

$thisURL='http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING'];

